package operation;

import book.BookList;

import java.util.Scanner;

public class BorrowedOperation implements IOPeration{
    @Override
    public void work(BookList bookList) {
        System.out.println("请输入你要借阅的书名：");
        Scanner scanner = new Scanner(System.in);
        String bookName = scanner.nextLine();
        int flag = bookList.BorrowedBook(bookName);
        if(flag == -1) {
            System.out.println("该书已被借阅");
        } else if(flag == 1) {
            System.out.println("借阅成功！");
        } else {
            System.out.println("查无此书！");
        }
    }
}
